import { v3, Vec3 } from "cc";
import { GlobalEnum } from "./GlobalEnum";

export class HPInfo {
    isShow: boolean = true;
    rate: number = 1;
    curRate: number = 1;
    isPlayer: boolean = false;
    wpos: Vec3 = v3();
    countTime: number = 0;
    type: number = 0;
    //
    isShadowReady = false;
}

export class BossHPInfo {
    bossName: string;
    rate: number = 1;
    curRate: number = 1;
    countTime: number = 0;
    //
    isShadowReady = false;
}

//格子 连接信息
export class ConnectProp {
    n: GlobalEnum.RailTypes;
    angY = 0;
    path: string[];
}


//初始的格子的信息
export class InitGridInfo {
    p: Vec3 = v3();
    //轨道名称
    type: GlobalEnum.RailTypes;
    //轨道连接类型ID
    connectKey: string = '';
    //是否固定
    isStatic: boolean = false;
    //---------train------
    //是否放置车厢
    hasTrain: boolean = false;
    //车厢初始移动方向
    trainDirec: GlobalEnum.MoveDirec = 0;
    //车厢id-从1开始
    trainId: number = 1;
}

//碰撞体关卡配置信息 //默认朝向 13
export class FenceInfo {
    bodyArr: { p: Vec3, r: Vec3, isOpen: boolean, grid?: any }[] = [];
    switch: { p: Vec3, r: Vec3 };
    colorType = 0; //唯一id
}

//隧道关卡配置信息-成对
export class TunnerInfo {
    A: { p: Vec3, r: Vec3, path: string };
    B: { p: Vec3, r: Vec3, path: string };
    colorType = 0; //唯一id
}

//三叉开关  //默认朝向 13
export class RailSwitchInfo {
    bodyArr: { p: Vec3, r: Vec3, type: GlobalEnum.RailTypes, grid?: any }[] = [];
    switch: { p: Vec3, r: Vec3 };
    colorType = 0; //唯一id
}
/**终点格子信息 */
export class EndGridInfo {
    p = v3();
    //连接信息
    connectKey = '';
    type = GlobalEnum.RailTypes.Rail_S; //固定
}